package tests;

import static org.junit.Assert.assertTrue;

import org.junit.Test;

import transformers.ContextTransformer;
import utils.Node;
import exceptions.AmbiguityException;

public class SpeedTest {

	@Test
	public final void testGetContext() throws AmbiguityException {
		// initialization
		TreeConstants.init();
		Node configuration = TreeConstants.configuration;
		Node rule = TreeConstants.rule3;
		
		ContextTransformer ct = new ContextTransformer(configuration);

		for(int i = 0; i < 10000; i++)
		{
			// verify
			Node context = ct.getContext(rule);
			assertTrue(context != null);
			
			// print results
/*			System.out.println("Configuration:");
			TreeUtils.printTree(configuration, "");
			System.out.println("Rule:");
			TreeUtils.printTree(rule, "");
			System.out.println("Context:");
			TreeUtils.printTree(context, "");
*/
		}
	}

}
